$(function(){
    //common
    ;(function(){
        var iBShare = {
            //初始化
            init: function() {
                var $shareBox = $(".bshare-custom");
                //加载分享工具
                var tools = '';
                tools = '<a title="分享到QQ空间" class="bshare-qzone"></a>';
                tools += '<a title="分享到腾讯微博" class="bshare-qqmb"></a>';
                tools += '<a title="分享到新浪微博" class="bshare-sinaminiblog"></a>';
                tools += '<a title="分享到微信" class="bshare-weixin"></a>';
//		        tools += '<a title="分享到人人网" class="bshare-renren"></a>';
//		        tools += '<a title="分享到网易微博" class="bshare-neteasemb"></a>';
//		        tools += '<a title="更多平台" class="bshare-more bshare-more-icon more-style-addthis"></a>';
                $shareBox.append(tools);
                //绑定分享事件
                $shareBox.children("a").click(function() {
                    var parents = $(this).parent();
                    bShare.addEntry({
                        title: parents.attr("title"),
                        url: parents.attr("url"),
                        summary: parents.attr("summary"),
                        pic: parents.attr("pic")
                    });
                });
            }
        };

        var url=location.search;
        var Request = new Object();
        if(url.indexOf("?")!=-1){
            var str = url.substr(1);
            strs = str.split("&");
            for(var i=0;i<strs.length;i++){
                Request[strs[i ].split("=")[0]]=unescape(strs[i].split("=")[1]);
            }
        }
        var id = Request["id"];

        $.ajax({
            url:'hxclub/articledetail/byIdContent.do',
            async:false,
            type: "post",
            data:{id:id},
            dataType: "json",
            success:function(json){
                //alert(json.data[0].id);
                var XHtml=template('xScr', json);
                $('#xCont').html(XHtml);
                $("head title").html($(".X3H2").html())
                iBShare.init();
            }
        });
    })();
});

